using System;
using System.Collections;
using System.Collections.Generic;
using Newtonsoft.Json;

using MarketPlace.Data.Bases;

namespace MarketPlace.Data.DomainModels
{
    [JsonObject(MemberSerialization.OptIn)]
    public partial class Region : BusinessBase<long>
    {
        #region Declarations

		private string _code = String.Empty;
		private string _name = String.Empty;
		private string _parentId = String.Empty;
		
		
		
		#endregion

        #region Constructors

        public Region() { }

        #endregion

        #region Methods

        public override int GetHashCode()
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            
            sb.Append(this.GetType().FullName);
			sb.Append(_code);
			sb.Append(_name);
			sb.Append(_parentId);

            return sb.ToString().GetHashCode();
        }

        #endregion

        #region Properties

        [JsonProperty]
		public virtual string Code
        {
            get { return _code; }
			set
			{
				OnCodeChanging();
				_code = value;
				OnCodeChanged();
			}
        }
		partial void OnCodeChanging();
		partial void OnCodeChanged();
		
        [JsonProperty]
		public virtual string Name
        {
            get { return _name; }
			set
			{
				OnNameChanging();
				_name = value;
				OnNameChanged();
			}
        }
		partial void OnNameChanging();
		partial void OnNameChanged();
		
        [JsonProperty]
		public virtual string ParentId
        {
            get { return _parentId; }
			set
			{
				OnParentIdChanging();
				_parentId = value;
				OnParentIdChanged();
			}
        }
		partial void OnParentIdChanging();
		partial void OnParentIdChanged();
		
        #endregion
    }
}
